package cn.jtfadmin.cms.controller;

import cn.jtfadmin.base.lang.common.utils.RequestUtils;
import cn.jtfadmin.cms.domain.dto.CmsPageHeadDTO;
import cn.jtfadmin.cms.domain.dto.CmsPageSysDTO;
import cn.jtfadmin.cms.domain.dto.CmsPageTopMenuDTO;
import cn.jtfadmin.cms.service.CmsPageService;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * cms 页面controller
 * @author jtf
 * @since 0.0.2
 */
@Controller
public class CmsPageController {

    @Autowired
    private CmsPageService service;

    @RequestMapping(value = {"/", "/cms/page/**"})
    public ModelAndView index(){

        HttpServletRequest request = RequestUtils.getRequest();
        return service.page(request.getServerName(), request.getRequestURI());
    }
}
